<template>
  <BasicModal title="添加规格" :minHeight="50" @register="registerModal">
    <div style="padding-top: 20px" class="flex-row-center-center">
      <Button style="margin-right: 10px" :type="'primary'" @click="handleAdd(GROUP)"
        >添加规格组</Button
      >
      <Button :type="'primary'" @click="handleAdd(ATTR)">添加规格项</Button>
    </div>
  </BasicModal>
</template>

<script setup lang="ts">
  import { Button } from 'ant-design-vue';
  import { useModalInner } from '@/components/Modal';
  import { SpuSpecificationTypeEnum } from '@/enums/spuEnum';
  import BasicModal from '@/components/Modal/src/BasicModal.vue';

  const { ATTR, GROUP } = SpuSpecificationTypeEnum;

  const [registerModal] = useModalInner();

  const emits = defineEmits(['add']);

  function handleAdd(type: SpuSpecificationTypeEnum) {
    emits('add', type);
  }
</script>

<style scoped lang="less"></style>
